package com.unicloud.medical.oss.client.autoconfigure;

import com.unicloud.medical.oss.client.selector.DefaultOssNameSelector;
import com.unicloud.medical.oss.client.selector.OssNameSelector;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@ConditionalOnMissingBean(OssNameSelector.class)
@Configuration
public class OssNameSelectorAutoConfiguration {

    @Value("${oss.client.oss-name}")
    private String ossName;

    @Bean
    public OssNameSelector defaultOssNameSelector() {
        return new DefaultOssNameSelector(ossName);
    }

}
